<?php
session_start();
if (empty($_SESSION['username'])) {
    echo '<script type="text/javascript">window.location.href="index.php";</script>';
} else {
    $now = time();
    if ($now > $_SESSION['expire']) {
        session_destroy();
        echo '<script type="text/javascript">var r=confirm("Session expire (30 mins)!"); if(r==true){window.location.href="../index.php";}else{window.location.href="index.php";}</script>';
    } else {
        require '../model-db-connection/config.php';
        $config = require '../model-db-connection/qrc_conf.properties.php';
    }
}
?>
<ul class="nav" id="side-menu">
    <li>
        <a href="../project-page/index-dashboard.php"><i class="fa fa-desktop"></i> Projects (โครงการ)</a>
    </li>
    <li>
        <a><i class="fa fa-bar-chart-o fa-fw"></i> Builder (ทีมช่าง) <span class="fa fa-arrow-down"></span></a>
        <ul class="nav nav-second-level">
            <li>
                <a href="../team-page/index-team.php"><i class="fa fa-steam-square"></i> Team (ทีม)</a>
            </li>
            <li>
                <a href="../member-page/index-member.php"><i class="fa fa-users"></i> Member (ลูกทีม)</a>
            </li>
        </ul>
        <!-- /.nav-second-level -->
    </li>
    <li>
        <a href="../assign-page/index-assign.php"><i class="fa fa-tasks"></i> Work Order (มอบหมาย)</a>
    </li>
    <li>
        <a><i class="fa fa-wrench fa-fw"></i> PO / Inspection <span class="fa fa-arrow-down"></span></a>
        <ul class="nav nav-second-level">
            <li>
                <a href="../po-page/index-po.php"><i class="fa fa-paper-plane"></i> PO (PO)</a>
            </li>
            <li>
                <a href="../inspection-page/index-inspection.php"><i class="fa fa-puzzle-piece"></i> Inspection (ใบตรวจรับงาน)</a>
            </li>
        </ul>
        <!-- /.nav-second-level -->
    </li>
    <li>
        <a href="../billing-page/index-billing.php"><i class="fa fa-files-o fa-fw"></i> Billing (PO/PR/ใบเสร็จ)</a>

    </li>
    <li>
        <a href="#"><i class="fa fa-sitemap fa-fw"></i> Search Report (ค้นหา/รายงาน)</a>

        <!-- /.nav-second-level -->
    </li>
</ul>